package com.lc.hot100.lc48;

import java.util.*;

public class Main {

}

class Solution {
	
	public void reverse(int[] p) {
		int l = 0, r = p.length - 1;
		while(l < r) {
			int t = p[l];
			p[l] = p[r];
			p[r] = t;
			l ++;
			r --;
		}
	}
	
	
    public void rotate(int[][] matrix) {
        
    	
    	int n = matrix.length;
    	int m = matrix[0].length;
    	
    	for (int i = 0; i < n; i ++) {
    		for (int j = 0; j < i; j ++) {
    			int tmp = matrix[i][j];
    			matrix[i][j] = matrix[j][i];
    			matrix[j][i] = tmp;
    		}
    	}
    	
    	for (int i = 0; i < n; i ++) {
    		
    		reverse(matrix[i]);
    		
    	}
    	
    }
}
